package com.cee.service.Impl;

import com.cee.dao.ExamShortAnswerMapper;
import com.cee.model.ExamShortAnswer;
import com.cee.service.ExamShortAnswerService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Slf4j
@Service
@Transactional
public class ExamShortAnswerServiceImpl implements ExamShortAnswerService {


    @Autowired
    private ExamShortAnswerMapper examShortAnswerMapper;


    @Override
    public int deleteExamShortAnswerById(Integer id) {
        return examShortAnswerMapper.deleteById(id);
    }

    @Override
    public int saveExamShortAnswer(ExamShortAnswer examShortAnswer) {
        return examShortAnswerMapper.insert(examShortAnswer);
    }

    @Override
    public List<ExamShortAnswer> getListByExamId(Integer examId) {
        return examShortAnswerMapper.getListByExamId(examId);
    }

    @Override
    public void updateExamShortAnswer(ExamShortAnswer examShortAnswer) {
        examShortAnswerMapper.updateExamShortAnswer(examShortAnswer);
    }
}
